import time

from selenium.webdriver.support.select import Select
from selenium import webdriver
from selenium.webdriver.common.by import By

# 1.打开浏览器

from selenium.webdriver.support.select import Select

# 创建浏览器对象
driver = webdriver.Chrome()
# 2.输入访问地址（URL）
url = r"E:\python_test\ui自动化测试\注册实例.html"
driver.get(url)
# 放大浏览器页面
driver.maximize_window()
time.sleep(3)
# 案例：打开‘注册实例.html’页面，完成以下操作
# 1). 填写主页面的注册信息
driver.find_element(By.CSS_SELECTOR, "#user").send_keys("admin")        #用户名
driver.find_element(By.CSS_SELECTOR, "#password").send_keys("123456")   #密码
driver.find_element(By.CSS_SELECTOR, "#tel").send_keys("13012345678")   #电话
driver.find_element(By.CSS_SELECTOR, "#email").send_keys("123@qq.com")  #邮箱
# 2). 填写注册页面A中的注册信息
driver.find_element(By.LINK_TEXT, "A网页").click()
time.sleep(3)
# 用户名
driver.find_element(By.CSS_SELECTOR, "#userA").send_keys("1111")
# # 密码
driver.find_element(By.CSS_SELECTOR, "#passwordA").send_keys("123456")
# 电话号码
driver.find_element(By.CSS_SELECTOR, "#telA").send_keys("13012345678")
# 电子邮件
driver.find_element(By.CSS_SELECTOR, "#emailA").send_keys("123@qq.com")

time.sleep(3)
driver.quit()